package Demo;
interface Unloadable{
    void unload();
}
interface Playable{
    void playMovie();
}
abstract class Vehicle {
    int wheels;
    float weight;

    public Vehicle(float weight,int wheels) {
        this.weight = weight;
        this.wheels = wheels;
    }

    public Vehicle() {
    }

    void show() {
        System.out.println("车轮个数"+wheels);
        System.out.println("车重"+weight);
    }

    public  void drive(){}
}

class Truck extends  Vehicle implements Unloadable,Playable{
    float load;

    public Truck(float weight, int wheels, float load) {
        super(weight, wheels);
        this.load = load;
    }
    void show() {
        System.out.println("我是卡车");
        super.show();
        System.out.println("载重量"+load);
    }

    @Override
    public void drive() {
        System.out.println("使用手动档驾驶");
    }

    @Override
    public void unload() {
        System.out.println("卡车能自动卸货");
    }

    @Override
    public void playMovie() {
        System.out.println("客车能播放电影");
    }
}

class Minibus extends  Vehicle implements Playable,Unloadable{
    int passenger;

    public Minibus(float weight, int wheels, int passenger) {
        super(weight, wheels);
        this.passenger = passenger;
    }

    void show(){
        System.out.println("我是面包车");
        super.show();
        System.out.println("载客数"+passenger);
    }

    public void drive() {
        System.out.println("使用自动档驾驶");
    }

    @Override
    public void playMovie() {
        System.out.println("客车能播放电影");
    }
    @Override
    public void unload() {
        System.out.println("卡车能自动卸货");
    }
}

public class Test {
    public static void main(String[] args) {
       Unloadable unloadable = new Truck(84.5f,4,5);
       unloadable.unload();
       Playable playable = new Minibus(75.5f,4,4);
       playable.playMovie();
    }
}

